{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "n = 5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def algorithm(n):\n",
    "    nums = [[0] * n for _ in range(n)]       #生成空数据\n",
    "    start_x, start_y = 0, 0                  #起始的横纵坐标\n",
    "    loop, mid = n //2, n//2                  #循环圈数\n",
    "    count = 1                                #计数器\n",
    "    \n",
    "    for offset in range(1, loop+1):\n",
    "        for j in range(start_y, n-offset):\n",
    "            nums[start_x][j] = count\n",
    "            count +=1\n",
    "        for i in range(start_x, n-offset):\n",
    "            nums[i][n-offset] = count\n",
    "            count +=1\n",
    "        for j in range(n-offset, start_y, -1):\n",
    "            nums[n-offset][j] = count\n",
    "            count +=1\n",
    "        for i in range(n-offset, start_x, -1):\n",
    "            nums[i][start_y] = count\n",
    "            count +=1\n",
    "        start_x +=1\n",
    "        start_y +=1\n",
    "    \n",
    "    if n%2 !=0:    #n为奇数\n",
    "        nums[mid][mid] = count   #填充中心值\n",
    "    return nums"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "def visualize_spiral_matrix(n):\n",
    "    matrix = algorithm(n)\n",
    "    fig, ax = plt.subplots()\n",
    "    ax.matshow(matrix, cmap='viridis')\n",
    "\n",
    "    for (i, j), val in np.ndenumerate(matrix):\n",
    "        ax.text(j, i, val, ha='center', va='center', color='white')\n",
    "\n",
    "    plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPUAAAD8CAYAAACvvuKtAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcn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ETyBLnUwtVbqNr35RGu9ElgZgExCiCCRt4kKYRgptRCGkVILYRgptRCGkVILYRgptRCGkVILYRgptRCGkVILYRgptRCGkVILYRgptRCGkVILYRgptRCGkVILYRgptRCGadPKJ37vVKkSIDfAu+0IlAZ4n8EUTnnDKSuEV95gZe2ptU5r7htBKXUwKKVytNajrM7hr3DKG05ZIbzyWpFVTr+FMIyUWgjDhFOp51gdoI3CKW84ZYXwyhvyrGHzmloI4Z9wOlILIfwgpRbCMFJqIQwjpRbCMFJqIQzz/wGgdnCp/gk8fAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "visualize_spiral_matrix(n)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
